package repositories;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import domain.Registration;

@Repository
public interface RegistrationRepository extends JpaRepository<Registration, Integer> {
	
	@Query("select r from Registration r where r.user.id = ?1 and r.project.id = ?2")
	Registration IsRegisteredForProject(int userId, int projectId);
	
	@Query("select r from Registration r where r.project.id=?1")
	Collection<Registration> findByProjectId(int id);


}
